package com.yxq.mdt.app.modules.socialcontact.presenter;

import com.yxq.mdt.app.base.BasePresenter;
import com.yxq.mdt.app.modules.socialcontact.bean.AttentionManAndDynamicBean;
import com.yxq.mdt.app.modules.socialcontact.bean.MaybeKnowBean;
import com.yxq.mdt.app.modules.socialcontact.bean.NearManAndDynamicTopicBean;
import com.yxq.mdt.app.modules.socialcontact.bean.SubscribersListBean;
import com.yxq.mdt.app.modules.socialcontact.model.MainSocialContactModel;
import com.yxq.mdt.app.net.ApiModel;

public class MainSocialAttemtionPresenter extends BasePresenter<MainSocialAttentionContract.View, MainSocialContactModel> implements MainSocialAttentionContract.Presenter {
    /**
     * 如果当前页面同时需要 Model 层和 View 层,则使用此构造函数(默认)
     *
     * @param rootView
     * @param model
     */
    public MainSocialAttemtionPresenter(MainSocialAttentionContract.View rootView, MainSocialContactModel model) {
        super(rootView, model);
    }


    @Override
    public void getMaybeKnowList(int pageNum, int pageSize) {
        mBaseModel.getMaybeKnow(pageNum, pageSize, new ApiModel.CommonCallback<AttentionManAndDynamicBean>() {
            @Override
            public void onSuccess(AttentionManAndDynamicBean s) {
                mRootView.onLoadMaybeKnowSuccess(s);
            }

            @Override
            public void onError(String errMsg) {
                mRootView.onLoadMaybeKnowFailed();
            }
        });
    }

    @Override
    public void getMySubscribersList(int pageNum, int pageSize) {
        mBaseModel.getSubscribersList(pageNum, pageSize, new ApiModel.CommonCallback<SubscribersListBean>() {
            @Override
            public void onSuccess(SubscribersListBean subscribersListBean) {
                mRootView.onLoadSubscribersListSuccess(subscribersListBean);
            }

            @Override
            public void onError(String errMsg) {
                mRootView.onLoadSubscribersListFailed();
            }
        });
    }

}
